package state.fromCsdn.impl;

import state.fromCsdn.Account;
import state.fromCsdn.AccountState;

public class OverdraftState extends AccountState {
    public OverdraftState(Account acc) {
        this.acc = acc;
    }

    @Override
    public void deposit(Double amount) {
        acc.setBalance(acc.getBalance() + amount);
    }

    @Override
    public void withdraw(Double amount) {
        acc.setBalance(acc.getBalance() - amount);
    }

    @Override
    public void computeInterest() {
        System.out.println("计算利息");
    }
}
